package com.itheima02.day06;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 刘全
 * @date 2021/7/22
 */
public class SimpleDateFormatDemo {
    public static void main(String[] args) throws ParseException {
        Date date = new Date();
        SimpleDateFormat s = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String str = s.format(date);
        System.out.println(str);
        String str2 = "1999-09-22";
        SimpleDateFormat s2 = new SimpleDateFormat("yyyy-MM-dd");

        System.out.println(s2.parse(str2));
    }
}
